﻿// Decompiled with JetBrains decompiler
// Type: DnProcessSimulateCommands.RunningSimulation.SimulationRecorder
// Assembly: DnProcessSimulateCommands, Version=2402.0.0.890, Culture=neutral, PublicKeyToken=null
// MVID: A885D881-AEDF-447E-852A-6F13102E089C
// Assembly location: C:\Program Files\Tecnomatix_2402\eMPower\DotNetCommands\DnProcessSimulateCommands.dll

using System.Resources;
using System.Windows.Forms;
using Tecnomatix.Engineering;


namespace DnProcessSimulateCommands.RunningSimulation;

public class SimulationRecorder : TxButtonCommand
{
  private bool m_alreadyOpened;

  public virtual void Execute(object cmdParams)
  {
    if (!TxApplication.ActiveDocument.PlatformGlobalServicesProvider.IsDataLoaded() || this.m_alreadyOpened)
      return;
    this.m_alreadyOpened = true;
    frmMain frmMain = new frmMain();
    ((Form) frmMain).FormClosed += new FormClosedEventHandler(this.form_FormClosed);
    frmMain.SemiModal = false;
    ((Control) frmMain).Show();
  }

  private void form_FormClosed(object sender, FormClosedEventArgs e)
  {
    this.m_alreadyOpened = false;
  }

  public virtual string Category => this.GetResourceManager().GetString("CMD_CATEGORY");

  public virtual string Name => this.GetResourceManager().GetString("CMD_NAME");

  private ResourceManager GetResourceManager()
  {
    return new ResourceManager("DnProcessSimulateCommands.SimulationRecorder.StringTable", ((object) this).GetType().Assembly);
  }

  public virtual string Bitmap => this.GetResourceManager().GetString("CMD_BITMAP");
}
